package com.syaccp.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.github.pagehelper.PageInfo;
import com.syaccp.model.SysUser;
import com.syaccp.request.SysUserRequest;
import com.syaccp.response.MenusResponse;
import com.syaccp.response.SysUserLoginResponse;
import com.syaccp.response.SystemAdminResponse;

/**
 * <p>
 * 用户信息表 服务类
 * </p>
 *
 * @author lixin
 * @since 2023-07-02
 */
public interface UserService  {

    List<SysUser> selectAll()throws SQLException;

    SysUser selectByUserName(SysUser user);

    public int updateUser(SysUserRequest sysUser);

    public int addUser(SysUserRequest sysUser);

    public List<SysUserRequest> userList(SysUserRequest sysUser);

    public PageInfo<SysUserRequest> pageGetUser(int index, SysUserRequest sysUser);

    public   SysUser loadUserByUsername(String username);

    SysUserLoginResponse login(SysUser sysUser, String ip);

    public boolean logout(HttpServletRequest request, HttpServletResponse response);

    /**
     * 根据Token获取对应用户信息
     */
    SystemAdminResponse getInfoByToken();


    /**
     * 获取登录页图片
     * @return Map
     */
    Map<String, Object> getLoginPic();

    /**
     * 获取管理员可访问目录
     * @return List<MenusResponse>
     */
    List<MenusResponse> getMenus();

}
